<template>
  <div class="all">
    <!--<div><the-header/></div>-->
    <div v-if=$store.state.user.loginStatus><the-header/></div>
    <!--<div v-else><Fakeheader/></div>-->
  </div>

  <router-view />

</template>

<script>
import TheHeader from "@/components/the-header.vue";
import Fakeheader from "./components/Fakeheader.vue";
import {useStore} from "vuex";

const debounce = (fn, delay) => {
  let timer = null;

  return function () {
    let context = this;

    let args = arguments;

    clearTimeout(timer);

    timer = setTimeout(function () {
      fn.apply(context, args);
    }, delay);
  };
};

// 解决ERROR ResizeObserver loop completed with undelivered notifications.

const _ResizeObserver = window.ResizeObserver;

window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
  constructor(callback) {
    callback = debounce(callback, 16);

    super(callback);
  }
};
export default {

  name: "App",
  components: { TheHeader,Fakeheader},
  setup(){

    const store = useStore()

    return{
    }
  }
};
</script>

<style scoped>
.all{
  margin: 0rem;
}
</style>
